<template>
  <ul class="todo-list">
  
    <li v-for="item in list" :key="item.id" :class="{completed:item.isDone}">
      <div class="view">
        <input v-model="item.isDone" class="toggle" type="checkbox" />
        <label>{{item.name}}</label>
       
        <button @click="delet(index)" class="destroy" ></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props:['list'],
  methods:{
     delet(index){
   this.$emit('delet',index)
 }
  }
}
</script>